﻿using System;
using System.Collections.Generic;
using System.Web;

using Gift.Model;

namespace WebSite
{
    public class BasePage : System.Web.UI.Page
    {
        public string ClientIP
        {
            get
            {
                string userIP;
                if(Request.ServerVariables["HTTP_VIA"] == null)
               {
                  userIP= Request.UserHostAddress;
                 }
               else
               {
                   userIP= Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                }
                 return userIP;

            }
        }

        public List<UserCard> UserCardCodeList
        {
            get
            {
                if (Session["UserCardCodeList"] != null)
                {
                    return (List<UserCard>)Session["UserCardCodeList"];
                }
                else
                {
                    return null;
                }
            }
            set
            {
                Session["UserCardCodeList"] = value;
            }
        }

     
        public string UserMemberId 
        {
              get
            {
                if (Session["memberid"] != null)
                {
                    return Session["memberid"].ToString();
                }else
                {
                    return null;
                }
            }
            set
            {
                Session["memberid"] = value;
            }
        }
        
    }

    
}